home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / kernserv / prototypes.h < prev    next >
Text File  |  1995-02-14  |  3KB  |  109 lines

  1. /*    @(#)ldd.h    2.0    03/20/90    (c) 1990 NeXT    
  2.  *
  3.  * kernserv/prototypes.h - kernel prototypes used by loadable device drivers
  4.  *
  5.  * HISTORY
  6.  * 22-May-91    Gregg Kellogg (gk) at NeXT
  7.  *    Split out public interface.  KERNEL_FEATURES is used to not conflict
  8.  *    with within-KERNEL definitions.
  9.  *
  10.  * 16-Aug-90  Gregg Kellogg (gk) at NeXT
  11.  *    Removed a lot of stuff that's defined in other header files. 
  12.  *    Eventually this file should either go away or contain only imports of
  13.  *    other files.
  14.  *
  15.  * 20-Mar-90    Doug Mitchell at NeXT
  16.  *    Created.
  17.  *
  18.  */
  19.  
  20. #ifndef    _KERN_INTERNAL_PROTOTYPES_
  21. #define _KERN_INTERNAL_PROTOTYPES_
  22.  
  23. #import <sys/types.h>
  24. #import <kernserv/printf.h>
  25. #import <sys/kernel.h>
  26. #import <sys/buf.h>
  27. #import <sys/uio.h>
  28. #ifdef    m68k
  29. #import <bsd/dev/m68k/autoconf.h>
  30. #endif    m68k
  31. #import <kernserv/machine/us_timer.h>
  32. #import <kernserv/lock.h>
  33.  
  34. /* Copy or initialize data: */
  35. int copyin(const void *p1, void *p2, unsigned int size);
  36. int copyout(const void *p1, void *p2, unsigned int size);
  37. void bcopy(const void *src, void *dest, int length);
  38. void bzero(void *bp, int size);
  39.  
  40. #ifdef    KERNEL
  41. #import <kernserv/kalloc.h>
  42. #import <mach/message.h>
  43.  
  44. /* Cause a thread to sleep or wakeup: */
  45. void    assert_wait(int event, boolean_t interruptible);
  46. void    biodone(struct buf *bp);
  47. void    biowait(struct buf *bp);
  48. void    clear_wait(thread_t thread, int result, boolean_t interrupt_only);
  49. void    thread_block(void);
  50. void    thread_set_timeout(int ticks);
  51. void    thread_sleep(int event, simple_lock_t lock, boolean_t interruptible);
  52.  
  53. /* Get information about this thread or task: */
  54.  
  55. #ifdef    MACH_USER_API
  56. extern task_t     current_task_EXTERNAL();
  57. extern thread_t    current_thread_EXTERNAL();
  58. #define current_task()     current_task_EXTERNAL()
  59. #define current_thread() current_thread_EXTERNAL()
  60. #endif    MACH_USER_API
  61.  
  62. task_t    (current_task)(void);
  63. int    thread_wait_result(void);
  64. extern  task_t task_self();
  65. extern     thread_t thread_self();
  66.  
  67. /* Create or kill a thread: */
  68. thread_t    kernel_thread(task_t task, void (*start)());
  69. void        thread_halt_self(void);
  70.  
  71. /* Send a message: */
  72. extern msg_return_t msg_send_from_kernel(
  73.     msg_header_t *msgptr,
  74.     msg_option_t option,
  75.     msg_timeout_t tout
  76. );
  77. #endif    KERNEL
  78.  
  79. /* Get or test a virtual address that corresponds to a hardware address: */
  80. caddr_t    map_addr(caddr_t address, int size);
  81. int    probe_rb(void *address);
  82.  
  83. /* Kill the loadable kernel server: */
  84. #if    defined(KERNEL) && !defined(KERNEL_BUILD) && !defined(ASSERT)
  85. #if    DEBUG
  86. #define    ASSERT(e) \
  87.     if ((e) == 0) { \
  88.         printf ("ASSERTION " #e " failed at line %d in %s\n", \
  89.             __LINE__, __FILE__); \
  90.         panic ("assertion failed"); \
  91.     }
  92. #else    DEBUG
  93. #define ASSERT(e)
  94. #endif    DEBUG
  95. #endif    defined(KERNEL) && defined(KERNEL_BUILD) && !defined(ASSERT)
  96.  
  97. /* Modify or inspect a string: */
  98. char *    strcat(char *string1, const char *string2);
  99. int     strcmp(const char *string1, const char *string2);
  100. int     strncmp(const char *string1, const char *string2, unsigned long len);
  101. char *    strcpy(char *to, const char *from);
  102. char *  strncpy(char *to, const char *from, unsigned long len);
  103. size_t     strlen(const char *string);
  104.  
  105. /* In a UNIX-style server, determine whether the user has root privileges: */
  106. int    suser(void);
  107.  
  108. #endif    _KERN_INTERNAL_PROTOTYPES_
  109.